home *** CD-ROM | disk | FTP | other *** search
- // Copyright 2001 Macromedia, Inc. All rights reserved.
- //-----------------------------------------------------
- //
- // Source Formatting Selection.js
- //
- // This file contains the implementation to fire off the Dreamweaver
- // source formatter to the selection.
-
- function canAcceptCommand(){
- var retVal = false;
- var dom = dw.getDocumentDOM();
-
- if (dom && (dom.getParseMode() == 'html' || dw.getDocumentDOM().getParseMode() == 'xml') && (dw.getFocus() == 'document' || dw.getFocus(true) == 'html' || dw.getFocus() == 'textView')){
- var selArr = dom.getSelection();
- if (selArr[0] == selArr[1]){
- retVal = false;
- }else{
- retVal = true;
- }
- }
-
- return retVal;
- }
-
- function formatSourceSelection()
- {
- dw.getDocumentDOM().formatSelection();
-
- return;
- }
-